package day01;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;

public class Test {
    public static void main(String[] args) throws Exception {
      /*  Func3 func3 = new Func3();
        String apply = func3.apply(1, 2, 3);

        MyFunction3<Integer, Integer, Integer, String> myFunc3 = new MyFunction3<Integer, Integer, Integer, String>() {
            @Override
            public String apply(Integer a, Integer b, Integer c) {
                return a+b+c+"";
            }
        };

        HaoGe haoGe = new HaoGe() {
            @Override
            public void eat() {

            }

            @Override
            public int add(int a, int b) {
                return 0;
            }
        };

        String name = HaoGe.name;


        String apply1 = myFunc3.apply(1, 2, 3);
        System.out.println(Dog.id());
        Dog.name_$eq("比鲁斯");
        System.out.println(Dog.name());
        Integer res = Dog.add().apply(1, 2);
        System.out.println(res);*/

/*
        ABC abc = new ABC();

        ABC xiangGe = new ABC("翔哥", 18, "male");

        ABC gege = new ABC("翔哥哥", 18, "male", "中南海");
*/

        ArrayList<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        //如果实现了iterable
        for (Integer integer : list) {

        }

        Iterator<Integer> list1 = list.iterator();
        while (list1.hasNext()){
            System.out.println(list1.next());
        }


        HashSet<Integer> set = new HashSet<>();
        set.add(1);
        set.add(2);
        set.add(3);
        set.add(4);

        Iterator<Integer> set1 = set.iterator();
        while (set1.hasNext()){
            System.out.println(set1.next());
        }

        HeroIterator it = new HeroIterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }

        MyIterable heroes = new MyIterable();
        Iterator<Hero> iterator = heroes.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }


    }
}

class Func3 implements MyFunction3<Integer,Integer,Integer,String>{
    @Override
    public String apply(Integer a, Integer b, Integer c) {
        return a+b+c+"";
    }
}



